main index
Main Optic Help Index

Optic Objects

Lenses

Mirrors

Light Sources

Prism

Procedures

Using the mouse

Zooming

Options

Printing

Refractive Index Calculations

Workspace Setup

Materials Database

Optic is a ray tracing program for modeling optical systems of lenses and mirrors.  There is no guarantee that the results of this program are correct.  In fact, there most likely are bugs.  So use it at your own risk.

This is alpha release version 0.2.

Chris Parks

Physics Department

Purdue University

W. Lafayette, IN 47907-1396

email: parks@physics.purdue.edu


computing index
Computing The Refractive Index

This dialog box in the misc menu lets you determine the refractive index of a material at a given wavelength.  Simple select the material from the list box and enter the wavelength in nm.  Then press the compute button to see the index value.  Press the exit button when you are finished.


workspace
Workspace Setup

Use the workspace command in the file menu to get the workspace dialog box.  With this dialog box you can specify the width and height of the workspace.  The color list box sets the background color of the screen.

You can also set the material of the workspace.  Normally this is Air with a refractive index of 1.00.  But it can be any material you choose.


material database
Materials Database Format

The data used to calculate the refractive index of a material as a function of wavelength is stored in the file "materials.dat".  You can add entries to this file to define your own materials.

Example

Each entry in the file has the following format:

Material: <name>

Min Wavelength: <min>

Max Wavelength: <max>

Funtion Type: <type>

Data: <n>

a0

a1

a2

...

a(n-1)

The meaning of each value is:

<name>	the name of the material.

<min>	the minimum wavelength for this material in microns.

<max>	the maximum wavelength for this material in microns.

<type>	the function to be used to compute the index.

<n>	the number of constants used by the formula.

All lines starting with '#' are treated as comment lines.

Function Types:

for all types x is the wavelength in microns.

Type 1

constant

n(x)=a0

Type 2

n(x)^2=a0 + a1*x^2 + a2/x^2 + a3/x^4 + a4/x^6 + a5/x^8

Type 3

n(x)^2= 1 + a0*x^2/(x^2-a1^2) + a2*x^2/(x^2-a3^2) + a4*x^2/(x^2-a5^2)

Type 4

polynomial

n(x)=a0 + a1*x + a2*x^2 + ... + an*x^n

Type 5

n(x)=a0 + a1*L(x) + a2*L(x)^2 + a3*x^2 + a4*x^4

L(x)=1/(x^2 - a5)

Type 6

n(x)^2=1 + a0 + a2*x^2/(x^2 - a3)

Type 7

n(x) is linearly interpolated from a data table.

The even number values (a0, a2, a4 ...) are the wavelengths and the odd numbered values (a1, a3, a5 ...) are the refractive index.  The index is computed in the following manner: for a wavelengths x (in microns) between a0 and a2 the index is interpolated between the index a1 and a3.  Likewise for x between a2 and a4 the index is interpolated between a3 and a5.  See also the example.


material database example
Material Example

See the "material.dat" file for more examples.

Say you had a table of refractive index vs. wavelength like this:

0.50	1.500

0.52	1.505

0.55	1.512

0.57	1.515

0.60	1.516

For a wavelength of 0.51 microns (510 nm) the program would use n=1.5025.

The entry in the material database would be:

Material: Example Material

Min Wavelength: 0.5

Max Wavelength: 0.6

Function Type: 6

Data: 10

0.50

1.5

0.52

1.505

0.55

1.512

0.57

1.515

0.60

1.516


Printing

At this point there is no direct printing from the program.  I haven't gotten around to it yet.  So what you can do is use the copy as graphic option in the edit menu.  Then paste the image from the clipboard into

your favorite graphics program.  This works well with object type drawing programs like CorelDraw.


Zooming

Zooming in

In order to zoom in on an area of the screen you must create a rectangle around that area.  To make this rectangle move the mouse to one corner.  Then press and hold the left mouse button while moving the mouse to the other corner.  A box will stretch and follow the mouse while you are holding down the button.  After you have sized the rectangle release the mouse button and select zoom in from the view menu.

Zooming out

The zoom out command in the view menu will cause the amount of area visible in the screen to double.

Zooming it all

The view everything command in the view menu will resize the viewing area so that every object will be visible on screen.


Using the mouse

Double Clicking

If you double click the left mouse button on an object, its dialog box will appear and you can change the parameters of the object.

Moving Objects

To move an object position the mouse cursor onto an object and press the left mouse button.  If you then move the mouse while holding down the left mouse button the object will move with the mouse.  Release the mouse button to let go of the object.

Selecting Objects

In order to select an object you must position the mouse cursor on the outline of the object.  Position the mouse onto an object and then press and release the mouse button.  The selected object will change color.

Stretching Objects

You can change the dimensions of an object with the mouse by using the right mouse button.  First select the object you want to change by clicking on its outline with the left mouse button.  To change the dimensions of the selected object point the mouse to part of the object you want to change, then press an hold the right mouse button.  If you move the mouse while holding down the right button the object will stretch with the mouse.  Each object responds differently depending on what part of its outline you stretch.  With most objects you can change its focal length, thickness, diameter, or some other parameter.  If you press the right mouse button while pointing the mouse somewhere not on the objects outline, then the object will rotate as you move the cursor.


Lenses

Double Convex

Plano Convex

Double Concave

Plano Concave

Meniscus


Mirrors

Flat

Spherical

Parabolic

Off axis parabolic

Off axis Ellipsoid

All mirrors have the option of putting a diffraction grating on the mirror surface.  For all gratings the rulings are specified by the number of lines per millimeter.  The rulings on the gratings are always oriented perpendicular to the screen so that the dispersion will be in the plane of the screen.

Note: If you set the reflectivity of a mirror less than zero, it will act like a black object.  The light rays will intersect with the mirror but no ray will reflect off or transmit through the mirror.


Prism

A prism is a triangular shaped transparent object.

With the right mouse button you can change the prism apex angle and baseline length.

The dialog box:

(x,y)

The x y coordinates of the prism are located at apex corner.

Baseline

The length of the bottom edge of the prism (the base).

Apex angle

The angle of the top peak of the prism.

Angle

The rotation angle of the prism.  An angle of zero puts the prism apex at the top and the base at the bottom.

Material

The material used to make the prism.

Color

The screen color used to draw the prism.


Flat Mirror

A flat mirror consists of a flat piece of material, such as glass, on which one side is coated with a reflecting material.

With the right mouse button you can change the mirror diameter, thickness, and angle.

The dialog box:

(x,y)

The x y coordinates of the mirror are located at the center of the mirrored surface.

Diameter

The length of the mirrored surface.

Thickness

The length of the surface perpendicular to the mirrored surface.

Reflectivity

The reflectivity of the mirrored surface.  1.00 is totally reflective.  0.00 is transparent.

Material

The substrate material used to make the mirror

Color

The color used to draw the mirror on screen.

Angle

An angle of zero corresponds to a vertical mirrored surface facing the left.  Positive angles rotates the mirror counter-clockwise.  Negative angles rotates the mirror clockwise.

lines/mm

Number of diffraction grating rulings per millimeter.  A value of zero means there is no diffraction grating on the mirror.


Spherical Mirror

A spherical mirror is the same shape as a plano concave lens with the spherical surface coated with a reflecting material.

With the right mouse button you can change the mirror thickness, diameter, focal length, and angle.

The dialog box

(x,y)

The x y coordinate of the mirror is located on the curve of the mirror at midway point of the curve.

Diameter

The diameter of the mirror.

Focus

The focal length of the mirror.  Positive focal lengths make concave mirrors and negative focal lengths represent convex focal lengths.  For spherical mirrors the radius of curvature is equal to twice the focal length.

Thickness

The thickness of the substrate material on which the mirror coating is deposited.   This is the thickness at the thinnest point of the mirror (at the center).

Reflectivity

The reflectivity of the coating on the substrate.  1.00 is 100% reflectivity.

Angle

At zero rotation angle, the mirrored surface faces to the left.  Positive rotation angles rotate the mirror counter-clockwise.

Material

This substrate material used to make the mirror

Color

The color used to draw the mirror on screen.

lines/mm

Number of diffraction grating rulings per millimeter.  A value of zero means there is no diffraction grating on the mirror.


Parabolic Mirror

The Dialog Box

(x,y)

The x y coordinates of a parabolic mirror are at the midpoint of the parabola (the center of the curve).

With the right mouse button you can change the mirror diameter, thickness, focal length, and angle.

Focus

The focal length of the mirror.  A point source placed at the focal point will produce a bundle of parallel light rays.

Thickness

The thickness of the substrate at the center of the mirror.

Angle

At zero rotation angle, the mirrored surface faces to the left.  Positive rotation angles rotate the mirror counter-clockwise.

Reflectivity

The reflectivity of the coated surface.  1.00 is 100% reflectivity.

Material

The substrate material used to make the mirror.

Color

The color used to draw the mirror on screen.

lines/mm

Number of diffraction grating rulings per millimeter.  A value of zero means there is no diffraction grating on the mirror.


Off Axis Parabolic Mirror

This is the same as the normal parabolic mirror except it does not have to be symmetrical around the focal point.

With the right mouse button you can change the mirror thickness, start angle, end angle, and the mirror angle.

The Dialog Box

(x,y)

The x y coordinates of a parabolic mirror are at same location as symmetrical parabolic mirror.  Note that depending on what you set the start angle and end angle, the curve of the parabola may or may not pass through the point (x,y),  If the start angle is less than zero and the end angle is greater than zero the curve will pass through the point (x,y).

Focus

The focal length of the mirror.  A point source placed at the focal point will produce a bundle of parallel light rays.

Thickness

The thickness of the substrate at the center of the mirror.

Start Angle

The starting angle of the reflective coating of the mirror.  The angle is measured with respect to the x-axis.  Positive angles are above the x-axis and negative angles are below the x-axis.  The starting angle must be less than the end angle.  The starting angle may not be less than -90 degrees.

End Angle

The end angle of the reflective coating of the mirror.  The angle is measured with respect to the x-axis.  Positive angles are above the x-axis and negative angles are below the x-axis.  The end angle must be greater than the start angle.  The end angle may not be greater than 90 degrees.

Angle

At zero rotation angle, the mirrored surface faces to the left.  Positive rotation angles rotate the mirror counter-clockwise.  To make a mirror which faces to the right or at any other angle always rotate the mirror.  Attempting to use the starting and ending angle parameters to make a rotated mirror simply will not work.

Reflectivity

The reflectivity of the coated surface.  1.00 is 100% reflectivity.

Material

The substrate material used to make the mirror.

Color

The color used to draw the mirror on screen.

lines/mm

Number of diffraction grating rulings per millimeter.  A value of zero means there is no diffraction grating on the mirror.


Off Axis Ellipsoidal Mirror

The Dialog Box

(x,y)

The x y coordinates of an ellipsoidal mirror are on the curve of the ellipse where the ellipse crosses the major axis.

With the right mouse button you can change the mirror thickness, start angle, end angle, and the rotation angle.  You will have to double click the left mouse button and use the dialog box to change the major or minor axis length.

Major axis

The length of the major axis.  The major axis is oriented along the x-axis (at zero rotation angle).

Minor axis

The length of the minor axis.  The minor axis is oriented along the y-axis (at zero rotation angle).

Thickness

The thickness of the substrate on the major axis.

Start Angle

The starting angle of the reflective coating of the mirror.  The angle is measured with relative to the x-axis and with relative to the center of the ellipse (not at the (x,y) coordinates of the ellipse).  Positive angles are above the x-axis and negative angles are below the x-axis.  The starting angle must be less than the end angle.  The starting angle may not be less than -90 degrees.

End Angle

The end angle of the reflective coating of the mirror.  The angle is measured with respect to the x-axis and the center of the ellipse.  Positive angles are above the x-axis and negative angles are below the x-axis.  The end angle must be greater than the start angle.  The end angle may not be greater than 90 degrees.

Angle

At zero rotation angle, the mirrored surface faces to the left.  Positive rotation angles rotate the mirror counter-clockwise.

Reflectivity

The reflectivity of the coated surface.  1.00 is 100% reflectivity.

Material

The substrate material used to make the mirror.

Color

The color used to draw the mirror on screen.

lines/mm

Number of diffraction grating rulings per millimeter.  A value of zero means there is no diffraction grating on the mirror.


light sources
Sources

Point

Collimated


point sorce
Point Source

All light rays originate radially from a single point.  The rays are emitted only between the starting and ending angles.  You can set as many as ten different wavelengths to originate from the same source.

With the right mouse button you can change the start and end angle of the rays.  You can also change the diameter of the pie slice image which represents the point source on the screen.  Changing the diameter of the pie slice has no effect on the rays emitted from the point source.

The Dialog Box

(x,y)

The x y coordinates for the starting point of each light ray.

Number of Rays

The number of light rays emitted by the point source.

Start Angle

The angle to start emitting rays.  The start angle must be less than the end angle.  The angle is measured with respect to the x-axis.  Positive angles are above the x-axis and negative angles are below the x-axis.

End Angle

The ending angle for emitting light rays.  The end angle must be greater than the starting angle.  The angle is measured with respect to the x-axis.  Positive angles are above the x-axis and negative angles are below the x-axis.

Wavelengths

This list box shows all the different wavelengths emitted by the point source.  Press Add to add a new wavelength.  Press change to change the wavelength or color of a ray.  Press delete to remove the selected ray from the list.

Collimated Source

The collimated source is used to produce a bundle of parallel rays of light.

With the right mouse button you can change the diameter and the angle of the ray bundle.

(x,y)

The x y coordinates of the center of the source.

Diameter

The diameter of the bundle of light rays.

Number of Rays

The number of rays forming the source.

Angle

The angle of the source.  The angle is measured with respect to the positive x-axis.  Positive angles are above the x-axis and negative angles are below the x-axis.

Wavelengths

This list box shows all the different wavelengths emitted by the source.  Press Add to add a new wavelength.  Press change to change the wavelength or color of a ray.  Press delete to remove the selected ray from the list.


Double Convex Lens

A double convex lens is a converging lens.  It is composed of two equal spherical surfaces.  The radii of the surfaces is computed with the lens maker's formula which only applies to a thin lens.  So if you create a thick lens the focal point will not be where you might normally expect.

With the right mouse button you can change the focal length, the diameter, and the angle of the lens.

The Dialog box:

(X,Y)

The x y coordinate of the lens is located at its exact center.

Focus

The focal length of the lens.

Thickness

This is the thickness of the lens at the edge of the lens.

Diameter

The diameter of the lens.

Angle

An angle of zero will produce a lens were the curved surfaces are oriented to the left and right of the (x,y) center coordinates.  Positive angles will rotate the lens counter clockwise.  Negative angles will rotate the lens clockwise.

Material

The material used to make the lens.

Color

The color used to draw the lens on screen.

Reflectivity

The reflectivity of the lens material.  1.00 means no light gets into the lens (it's really a mirror).  0.00 means the lens surfaces do not reflect light.


Plano Convex Lens

A plano convex lens is a converging lens.  It is composed of one spherical surface and one flat surface.  It is equal to a double convex lens where one surface has an infinite radius.  The radii of the curved surface is computed with the lens maker's formula which only applies to a thin lens.  So if you create a thick lens the focal point will not be where you might normally expect.

With the right mouse button you can change the lens thickness, diameter, focal length, and angle.

The Dialog box:

(X,Y)

The x y coordinate of the lens is located at its horizontal and vertical center.

Focus

The focal length of the lens.

Thickness

This is the thickness of the lens at the edge of the lens.

Diameter

The diameter of the lens.

Angle

An angle of zero will produce a lens were the curved surface is to the left and the plano surface is to right of the (x,y) center coordinates.  Positive angles will rotate the lens counter clockwise.  Negative angles will rotate the lens clockwise.

Material

The material used to make the lens.

Color

The color used to draw the lens on screen.

Reflectivity

The reflectivity of the lens material.  1.00 means no light gets into the lens (it's really a mirror).  0.00 means the lens surfaces do not reflect light.


Double Concave Lens

A double concave lens is a diverging lens.  It is composed of two equal spherical surfaces.  The radii of the surfaces is computed with the lens maker's formula which only applies to a thin lens.  So if you create a thick lens the focal point will not be where you might normally expect.

With the right mouse button you can change the lens diameter, focal length, and angle.

The Dialog box:

(X,Y)

The x y coordinate of the lens is located at its exact center.

Focus

The focal length of the lens.  Diverging lenses require negative focal lengths.

Thickness

This is the thickness of the lens at the center of the lens.

Diameter

The diameter of the lens.

Angle

An angle of zero will produce a lens were the curved surfaces are oriented to the left and right of the (x,y) center coordinates.  Positive angles will rotate the lens counter clockwise.  Negative angles will rotate the lens clockwise.

Material

The material used to make the lens.

Color

The color used to draw the lens on screen.

Reflectivity

The reflectivity of the lens material.  1.00 means no light gets into the lens (it's really a mirror).  0.00 means the lens surfaces do not reflect light.


Plano Concave Lens

A plano concave lens is a diverging lens.  It is composed of one spherical surface and one flat surface.  It is equal to a double concave lens where one surface has an infinite radius.  The radii of the curved surface is computed with the lens maker's formula which only applies to a thin lens.  So if you create a thick lens the focal point will not be where you might normally expect.

With the right mouse button you can change the lens diameter, focal length, and angle.

The Dialog box:

(X,Y)

The x y coordinate of the lens is located at its horizontal and vertical center.

Focus

The focal length of the lens.  Diverging lenses require negative focal lengths.

Thickness

This is the thickness of the lens at the edge of the lens.

Diameter

The diameter of the lens.

Angle

An angle of zero will produce a lens were the curved surface is to the left and the plano surface is to right of the (x,y) center coordinates.  Positive angles will rotate the lens counter clockwise.  Negative angles will rotate the lens clockwise.

Material

The material used to make the lens.

Color

The color used to draw the lens on screen.

Reflectivity

The reflectivity of the lens material.  1.00 means no light gets into the lens (it's really a mirror).  0.00 means the lens surfaces do not reflect light.


Meniscus Lens

A meniscus lens is an asymmetrical lens which is either a diverging lens or a converging lens.  It is composed of two spherical surfaces which generally have different radii.  In contrast to the other lens types where you specify the focal length and the radii are automatically computed, a meniscus lens requires you to specify the radii.  This is because many different radii with lead to the same focal length with a meniscus lens.  The focal length of the lens is computed with the lens maker's formula which only applies to a thin lens.  So if you create a thick lens the focal point will not be where you might normally expect.

With the right mouse button you can change the radius of both spherical surfaces, the diameter, and the angle of the lens.

The Dialog box:

(X,Y)

The x y coordinate of the lens is located at its horizontal and vertical center.

Diameter

The diameter of the lens.

Radius 1

This is the radius of the spherical surface on the left hand side of the lens.  Positive numbers place the center of the sphere on the right hand side of the lens.  Negative numbers place the center of the sphere on the left hand side of the lens.

Radius 2

This is the radius of the spherical surface on the right hand side of the lens.

Thickness

This is the thickness of the lens at the edge of the lens.

Angle

An angle of zero will produce a lens were Radius 1 is to the left and Radius 2 is to the right of the (x,y) center coordinates.  Positive angles will rotate the lens counter clockwise.  Negative angles will rotate the lens clockwise.

Material

The material used to make the lens.

Color

The color used to draw the lens on screen.

Reflectivity

The reflectivity of the lens material.  1.00 means no light gets into the lens (it's really a mirror).  0.00 means the lens surfaces do not reflect light.


Options

Intensity levels

If you select show intensity level then when the ray tracing is done the intensity of each ray will be shown by writing the intensity of the ray next to it.  The numbers go from 0 to 100 with 100 being strongest and 0 being the weakest.

Automatic tracing

If you have a slow computer then turn this check box off.  Normally the computer will retrace the window every time you move or adjust an object.  With automatic tracing turned off you will have to select trace now from the edit menu in order to see the traced rays.

Minimum intensity level

This is the threshold intensity level for ray tracing.  If the intensity of a refracted or transmitted ray drops below this level then the computer will stop following the path of the ray because its intensity is too weak.

Maximum diffraction order

Light can be diffracted from a diffraction grating into many different orders for a given wavelength.  This option lets you limit how many orders are traced.  A value of 1 means only the first order diffracted light will be traced.  The zero order is always traced.


Thin lens

A lens where the diameter is much larger than its thickness.